package com.ad.advertiser.dao.impl;

import com.ad.advertiser.dao.IAdUserDAO;
import com.ad.common.dao.UserDAO;
import com.ad.common.entity.User;

public class AdUserDAOImpl implements IAdUserDAO{
	private UserDAO userDAO ;
	@Override
	public User findByUsername(String username) {
		return this.userDAO.findByUsername(username);
	}

	public UserDAO getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	@Override
	public User query(String username, String password, int userType) {
		return this.userDAO.loginQuery(username, password, userType);
	}

	@Override
	public boolean save(User user) {
		return this.userDAO.save(user);
	}

	@Override
	public void update(User user) {
		this.userDAO.saveOrUpdate(user);
	}

}
